package ch.myrss.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.MouseListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class MyRSS implements EntryPoint {

    /**
         * This is the entry point method.
         */
    public void onModuleLoad() {


	// "Add RSS Feed" Button
	final Image addButton = new Image("img/buttons/add.png");
	
	addButton.addMouseListener(new MouseListener() {

	    public void onMouseDown(Widget sender, int x, int y) {
		addButton.setUrl("img/buttons/add_click.png");
	    }

	    public void onMouseEnter(Widget sender) {
		addButton.setUrl("img/buttons/add_hover.png");
	    }

	    public void onMouseLeave(Widget sender) {
		addButton.setUrl("img/buttons/add.png");
	    }

	    public void onMouseMove(Widget sender, int x, int y) {
		addButton.setUrl("img/buttons/add_hover.png");
	    }

	    public void onMouseUp(Widget sender, int x, int y) {

	    }
	    
	});
	addButton.addClickListener(new ClickListener() {

	    public void onClick(Widget sender) {
		new AddRSSPopup(addButton.getAbsoluteLeft(), addButton.getAbsoluteTop());
	    }
	    
	});
	
	RootPanel.get("slot1").add(addButton);
	RootPanel.get("slot3").add(new Image("img/placeholder.gif"));



    }
}
